package com.viewshine.webservicedemo.service;

import com.viewshine.webservicedemo.entity.Dog;
import org.springframework.stereotype.Component;

import javax.jws.WebParam;
import javax.jws.WebService;
import java.util.Random;

/**
 * @ClassName TestServiceImpl
 * @Author rhb
 * @Description //TODO
 * @Date 2019-01-16 14:39
 * @Version 1.0
 **/
@Component
//@WebService(serviceName = "TestService", //对外发布的服务名
//        portName = "Test",
//        targetNamespace = "http://service.ws.sample/", //指定你想要的名称空间，通常使用使用包名反转
//        endpointInterface = "com.viewshine.webservicedemo.service.TestService")//服务接口全路径, 指定做SEI（Service EndPoint Interface）服务端点接口
public class TestServiceImpl implements TestService{
    @Override
    public String test(Long id, String name) {
        return "TestServiceImpl...;id="+id+" name="+name;
    }


    @Override
    public Dog getOne(/*@WebParam(name = "a",targetNamespace="http://a.org/")*/ Integer id) {
        if (id==1){
            return new Dog(1L,"嘟嘟",10,true);
        }else if (id==2){
            return new Dog(2L,"来福",12,false);
        }else {
            return new Dog(new Random().nextLong(),"啊哈",99,false);
        }
    }
}
